<?php

// don't load directly
if ( !defined('ABSPATH') )
	die('-1');

// Define Constants
// EDIT: use WP constants
define('BP_URL', WP_CONTENT_URL . '/themes/buildpress');
define('BP_ABSPATH', WP_CONTENT_DIR . '/themes/buildpress');
define('BP_REPO_URL', BP_URL . '/engine/includes/css'); //repo url
define('BP_REPO_ABSPATH', BP_ABSPATH . '/engine/includes/css'); //repo abs path


// Include buildpress class file
require_once(BP_ABSPATH . '/engine/buildpress.load.php'); //loads engine loader

if ( is_admin() && current_user_can('edit_themes') ) { // EDIT: add cap check
	require_once(BP_ABSPATH . '/engine/admin/buildpress.admin.page.php'); //load admin buildpress
	
	// EDIT: are these only needed for ajax?
	if ( defined('DOING_AJAX') )
	require_once(BP_ABSPATH . '/engine/admin/buildpress.admin.ajax.functions.php'); //load admin+builder ajax
}

if ( function_exists('register_sidebar') ) {
			register_sidebar(array(
				'name' => 'Sidebar 1',
				'before_widget' => '<li id="%1$s" class="widget %2$s">',
				'after_widget' => '</li>',
				'before_title' => '<h3 class="widgettitle">',
				'after_title' => '</h3>',
			));
			
			register_sidebar(array(
				'name' => 'Sidebar 2',
				'before_widget' => '<li id="%1$s" class="widget %2$s">',
				'after_widget' => '</li>',
				'before_title' => '<h3 class="widgettitle">',
				'after_title' => '</h3>',
			));
			
			register_sidebar(array(
				'name' => 'Widget Top',
				'before_widget' => '<div id="%1$s" class="widget %2$s">',
				'after_widget' => '</div>',
				'before_title' => '<h3 class="widgettitle">',
				'after_title' => '</h3>',
			));
			
			register_sidebar(array(
				'name' => 'Widget Bottom',
				'before_widget' => '<div id="%1$s" class="widget %2$s">',
				'after_widget' => '</div>',
				'before_title' => '<h3 class="widgettitle">',
				'after_title' => '</h3>',
			));
}


?>
